package string;

public class MatchesDemo04 {
    public static void main(String[] args) {
        String mobile = "156 0010 1234";
        boolean b = mobile.matches("\\d{3}\\s?\\d{4}\\s?\\d{4}");
        System.out.println(b);

        b = mobile.matches("\\d{3}\\s*\\d{4}\\s*\\d{4}");
        System.out.println(b);

        b = mobile.matches("\\d{3}\\s+\\d{4}\\s+\\d{4}");
        System.out.println(b);

        mobile = "15600101234";
        b = mobile.matches("(0086)?\\d{11}");
        System.out.println(b);

    }
}
